package com.dux.commons.network;

import java.io.IOException;
import java.nio.channels.SocketChannel;


/**
 * 连接工厂接口
 * {@link com.game.commons.network.Acceptor}通过此类来创建连接实例
 * @author 杜祥
 * @create 2013-6-3
 */
public interface ConnectionFactory 
{
	/**
	 * 创建{@link com.game.commons.network.MMOConnection}实例
	 * @param socket		
	 * @param dispatcher
	 * @return				
	 * 					返回一个{@link com.game.commons.network.MMOConnection}实体
	 * @throws IOException
	 * @see {@link com.game.commons.network.MMOConnection}
	 * @see {@link com.game.commons.network.Dispatcher}
	 */
	public MMOConnection create(SocketChannel socket, Dispatcher dispatcher) throws IOException;
}
